#include <bits/stdc++.h>
#define int long long
using namespace std;

template<typename T>
T read(T x)
{
    T opt = 1, sum = 0;
    char ch = getchar();
    while(!isdigit(ch)) opt = (ch == '-') ? -1 : 1, ch = getchar();
    while( isdigit(ch)) sum = (sum << 1) + (sum << 3) + (ch ^ 48), ch = getchar();
    return opt * sum;
}
#define read read(0ll)
inline void put(int x)
{
    if(x > 9) put(x / 10);
    putchar(x % 10 + 48);
}
int ans;
const int N = 1e5 + 5;
int a[N];
signed main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    int n = read; ans = n;
    for(int i = 1;i <= n;i ++ ) a[i] = read;
    sort(a + 1,a + 1 + n);
    int r;
    int l = 1; for(int i = 2;i <= n;i ++ ){
        if(a[i] != a[1]) {r = i; break;}
    }
    while(r != n + 1){
        if(a[r] > a[l]){
            l ++ ;ans -- ;
        }
        r ++ ;
    }
    cout << ans << endl;
    return 0;
}
